1. Field of the Invention
The present invention relates to technology for accessing memory space in a microprocessor.
2. Description of the Related Art
Conventionally, one way of placing a RAM area and a ROM area in a memory address space provided in a microprocessor seeks to shorten instruction codes and instruction execution cycles. This placement method involves placing the RAM area at a head of the memory address space; that is, in a memory address space having a relatively low value. This allows for the utilization of so-called short addressing access, in which the CPU, when accessing the RAM area, designates and accesses only the low order bits of memory addresses, the high order bits having being omitted. Using this access method, it is possible to shorten instruction operands for designating memory addresses, and as a result instruction codes and instruction execution cycles can be shortened.
More specifically, the RAM area is placed, for example, to include memory addresses x‘00000’ to x‘000FF’ (x‘ ’ showing that the numerical values within the ‘ ’ form a hexadecimal memory address) within memory space expressed by 20-bit memory addresses. To access x‘00000’ to x‘000FF’ in the RAM area, it thus becomes possible for the CPU to designate and access only the low order 8 bits, and the high order 12 bits are omitted. Here, the ROM area is placed after the RAM area; that is, in memory address locations having higher values than the memory addresses in which the RAM area is placed.
Consideration will now be given to placing memory areas in the memory address space of the above microprocessor, when another RAM is newly added and the RAM area is extended. So as to be also able to employ short addressing access after extending, placement of the existing RAM area (referred to as “basic RAM”) must still be at the head of the memory address space after extending. As such, the placement method for the various areas is, in the order from an address head: basic RAM area, ROM area, newly added RAM area (referred to as “extension RAM”), or: basic RAM area, extension RAM area, ROM area.
When the placement method is in the order, basic RAM area, ROM area, extension RAM area, there is no need to change the pre-extension placement of the basic RAM area and ROM area. Software created for the microprocessor prior to the extension can also be used post-extension, and software compatibility can thus be preserved after extending.
However with this placement method, memory addresses of the basic RAM area and the extension RAM area are separated by the ROM area and are thus discontinuous. This becomes a problem when memory addresses are accessed sequentially in ascending order in transferring large amounts of data.
On the other hand, when the placement method is in the order, basic RAM area, extension RAM area, ROM area, consecutive memory addresses can be allotted to the basic RAM area and the extension RAM area. Since the above problem does not arise, this placement method is suitable when large amounts of data are accessed in the memory address order.
However with this placement method, because the extension RAM area is placed after the basic RAM area, the ROM area has to be shifted back from its pre-extension placement. Since the memory addresses allotted to the ROM area change from pre- to post-extension of the RAM area, the problem arises of not being able to employ pre-extension software created for the microprocessor after extending.